package com.joelaws.prototype.client.data;

import java.io.Serializable;

public class User implements Serializable, Cloneable {

	private static final long serialVersionUID = 1L;

	private long userID;

	private String firstName;

	private String lastName;

	private String email;

	private String password;

	private DatingService datingService;

	private NetworkingService networkingService;

	private MessagingService messagingService;

	public User() {
	}

	private User(long userID, String firstName, String lastName, String email, String password,
			DatingService datingService, NetworkingService networkingService, MessagingService messagingService) {
		this.userID = userID;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.password = password;
		this.datingService = datingService;
		this.networkingService = networkingService;
		this.messagingService = messagingService;
	}

	public User(String firstName, String lastName, String email, String password) {
		this.userID = 0;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.password = password;
	}

	public User clone() {
		return new User(userID, firstName, lastName, email, password, datingService, networkingService,
				messagingService);
	}

	public boolean equals(Object o) {
		return (o instanceof User) ? this.email == ((User) o).email : false;
	}

	public int hashCode() {
		return new Long(userID).hashCode();
	}

	public boolean isMale() {
		return networkingService.getNetworkingDetails().isMale();
	}

	public long getUserID() {
		return userID;
	}

	public void setUserID(long userID) {
		this.userID = userID;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public DatingService getDatingService() {
		return datingService;
	}

	public void setDatingService(DatingService datingService) {
		this.datingService = datingService;
	}

	public NetworkingService getNetworkingService() {
		return networkingService;
	}

	public void setNetworkingService(NetworkingService networkingService) {
		this.networkingService = networkingService;
	}

	public MessagingService getMessagingService() {
		return messagingService;
	}

	public void setMessagingService(MessagingService messagingService) {
		this.messagingService = messagingService;
	}

	public DatingDetails getDatingDetails() {
		return datingService.getDatingDetails();
	}

	public void setDatingDetails(DatingDetails datingDetails) {
		datingService.setDatingDetails(datingDetails);
	}

	public NetworkingDetails getNetworkingDetails() {
		return networkingService.getNetworkingDetails();
	}

	public void setNetworkingDetails(NetworkingDetails networkingDetails) {
		networkingService.setNetworkingDetails(networkingDetails);
	}

	public Picture getPicture() {
		return networkingService.getPicture();
	}

	public void setPicture(Picture picture) {
		networkingService.setPicture(picture);
	}
}
